package com.btpj.module_main.ui.widgets.tag_flow

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

/**
 * 适配器模式提供TagFlowLayout调用的Adapter
 *
 * @author LTP 2020/7/13
 */
abstract class TagFlowAdapter {

    private lateinit var mListener: NotifyDataSetChangedListener

    abstract fun getItemCount(): Int

    abstract fun createView(inflater: LayoutInflater, parent: ViewGroup, position: Int): View

    abstract fun bindView(view: View, position: Int)

    open fun onItemViewClick(view: View, position: Int) {}

    fun setNotifyDataSetChangedListener(listener: NotifyDataSetChangedListener) {
        this.mListener = listener
    }
}